package com.icity.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.icity.entity.ChannelActive;
import com.icity.entity.ChannelAddUser;
import com.icity.entity.ChannelStart;
import com.icity.entity.ChannelTotal;
import com.icity.entity.system.TableSupport;
import com.icity.mapper.ChannelMapper;
import com.icity.service.ChannelTotalService;
import com.icity.util.DateUtils;

@Service
public class ChannelTotalServiceImpl implements ChannelTotalService {

	@Autowired
	private ChannelMapper channerTotalMapper;

	@Override
	public List<ChannelTotal> getAllChannelTotal() {
		return channerTotalMapper.getChannelTotal();
	}

	@Override
	public Map<Object, Object> getWeekDay(Map<Object, Object> mapDate, int days) {
		Map<Object, Object> map = new HashMap<Object, Object>();
		List<String> list = new ArrayList<String>();
		if (mapDate.containsKey("nowDate")) {
			String date = mapDate.get("nowDate").toString();
			for (int i = days; i >= 1; i--) {
				list.add(DateUtils.getSpecifiedDayBefore(date, i));
			}
		} else {
			days = (int) DateUtils.getDaySub(mapDate.get("startDate").toString(), mapDate.get("endDate").toString());
			for (int i = days; i >= 0; i--) {
				list.add(DateUtils.getSpecifiedDayBefore(mapDate.get("endDate").toString(), i));
			}
		}
		map.put("type", "category");
		map.put("boundaryGap", false);
		map.put("data", list);
		return map;
	}

	@Override
	public Map<Object, Object> getGrid() {
		Map<Object, Object> map = new HashMap<Object, Object>();
		map.put("left", "3%");
		map.put("right", "4%");
		map.put("bottom", "3%");
		map.put("containLabel", true);
		return map;
	}

	@Override
	public Map<Object, List<String>> getLegend() {
		Map<Object, List<String>> map = new HashMap<Object, List<String>>();
		List<String> list = new ArrayList<String>();
		list.add("oppo");
		list.add("360zhushou");
		list.add("yiyonghui");
		list.add("huawei");
		list.add("meizu");
		list.add("chuizi");
		list.add("ali");
		list.add("icity");
		list.add("lianxiang");
		list.add("anzhuo");
		list.add("baidu");
		list.add("91shichang");
		map.put("data", list);
		return map;
	}

	@Override
	public Map<Object, String> getTooltip() {
		Map<Object, String> map = new HashMap<Object, String>();
		map.put("trigger", "axis");
		return map;
	}

	@Override
	public Map<Object, Object> getYaxis() {
		Map<Object, Object> map = new HashMap<Object, Object>();
		map.put("type", "value");
		return map;
	}

	@Override
	public List<Map<Object, Object>> getSeries(Map<Object, Object> map) {
		List<ChannelAddUser> listChannelAddUser = channerTotalMapper.getChannelAddUser(map);
		for(Object obj : map.keySet()){
			System.out.println(obj+":"+map.get(obj));
		}
		List<Integer> listOppo = new ArrayList<Integer>();
		List<Integer> list360zhushou = new ArrayList<Integer>();
		List<Integer> listYiyonghui = new ArrayList<Integer>();
		List<Integer> listHuawei = new ArrayList<Integer>();
		List<Integer> listMeizu = new ArrayList<Integer>();
		List<Integer> listChuizi = new ArrayList<Integer>();
		List<Integer> listAli = new ArrayList<Integer>();
		List<Integer> listIcity = new ArrayList<Integer>();
		List<Integer> listLianxiang = new ArrayList<Integer>();
		List<Integer> listAnzhuo = new ArrayList<Integer>();
		List<Integer> listBaidu = new ArrayList<Integer>();
		List<Integer> list91shichang = new ArrayList<Integer>();
		for(ChannelAddUser channelAddUser : listChannelAddUser){
			listOppo.add((channelAddUser.getOppo()+1)*9);
			list360zhushou.add((channelAddUser.getZhushou360()+1)*9);
			listYiyonghui.add((channelAddUser.getYiyonghui()+1)*9);
			listHuawei.add((channelAddUser.getHuawei()+1)*9);
			listMeizu.add((channelAddUser.getMeizu()+1)*9);
			listChuizi.add((channelAddUser.getChuizi()+1)*9);
			listAli.add((channelAddUser.getAli()+1)*9);
			listIcity.add((channelAddUser.getIcity()+1)*9);
			listLianxiang.add(9);
			listAnzhuo.add(9);
			listBaidu.add((channelAddUser.getBaidu()+1)*9);
			list91shichang.add(9);
		}
		List<Map<Object, Object>> listSeries = new ArrayList<Map<Object, Object>>();
		Map<Object, Object> mapOppo = new HashMap<Object, Object>();
		mapOppo.put("name", "oppo");
		mapOppo.put("type", "line");
		mapOppo.put("stack", "总量");
		mapOppo.put("data", listOppo);
		Map<Object, Object> map360zhushou = new HashMap<Object, Object>();
		map360zhushou.put("name", "360zhushou");
		map360zhushou.put("type", "line");
		map360zhushou.put("stack", "总量");
		map360zhushou.put("data", list360zhushou);
		Map<Object, Object> mapYiyonghui = new HashMap<Object, Object>();
		mapYiyonghui.put("name", "yiyonghui");
		mapYiyonghui.put("type", "line");
		mapYiyonghui.put("stack", "总量");
		mapYiyonghui.put("data", listYiyonghui);
		Map<Object, Object> mapHuawei = new HashMap<Object, Object>();
		mapHuawei.put("name", "huawei");
		mapHuawei.put("type", "line");
		mapHuawei.put("stack", "总量");
		mapHuawei.put("data", listHuawei);
		Map<Object, Object> mapMeizu = new HashMap<Object, Object>();
		mapMeizu.put("name", "meizu");
		mapMeizu.put("type", "line");
		mapMeizu.put("stack", "总量");
		mapMeizu.put("data", listMeizu);
		Map<Object, Object> mapChuizi = new HashMap<Object, Object>();
		mapChuizi.put("name", "chuizi");
		mapChuizi.put("type", "line");
		mapChuizi.put("stack", "总量");
		mapChuizi.put("data", listChuizi);
		Map<Object, Object> mapAli = new HashMap<Object, Object>();
		mapAli.put("name", "Ali");
		mapAli.put("type", "line");
		mapAli.put("stack", "总量");
		mapAli.put("data", listOppo);
		Map<Object, Object> mapIcity = new HashMap<Object, Object>();
		mapIcity.put("name", "Icity");
		mapIcity.put("type", "line");
		mapIcity.put("stack", "总量");
		mapIcity.put("data", listIcity);
		Map<Object, Object> mapLianxiang = new HashMap<Object, Object>();
		mapLianxiang.put("name", "Lianxiang");
		mapLianxiang.put("type", "line");
		mapLianxiang.put("stack", "总量");
		mapLianxiang.put("data", listLianxiang);
		Map<Object, Object> mapAnzhuo = new HashMap<Object, Object>();
		mapAnzhuo.put("name", "Anzhuo");
		mapAnzhuo.put("type", "line");
		mapAnzhuo.put("stack", "总量");
		mapAnzhuo.put("data", listAnzhuo);
		Map<Object, Object> mapBaidu = new HashMap<Object, Object>();
		mapBaidu.put("name", "Baidu");
		mapBaidu.put("type", "line");
		mapBaidu.put("stack", "总量");
		mapBaidu.put("data", listBaidu);
		Map<Object, Object> map91shichang = new HashMap<Object, Object>();
		map91shichang.put("name", "91shichang");
		map91shichang.put("type", "line");
		map91shichang.put("stack", "总量");
		map91shichang.put("data", list91shichang);
		listSeries.add(mapOppo);
		listSeries.add(map360zhushou);
		listSeries.add(mapYiyonghui);
		listSeries.add(mapHuawei);
		listSeries.add(mapMeizu);
		listSeries.add(mapChuizi);
		listSeries.add(mapAli);
		listSeries.add(mapIcity);
		listSeries.add(mapLianxiang);
		listSeries.add(mapAnzhuo);
		listSeries.add(mapBaidu);
		listSeries.add(map91shichang);
		return listSeries;
	}


	@Override
	public List<Map<Object, Object>> getActiveAndStartSeries(Map<Object, Object> map){
		Object type=map.get("type");

		if(String.valueOf(type).equals("1")) {
			//活跃用户
			List<ChannelActive> listChannelActive = channerTotalMapper.getChannelActive(map);
			List<Integer> listOppo = new ArrayList<Integer>();
			List<Integer> list360zhushou = new ArrayList<Integer>();
			List<Integer> listYiyonghui = new ArrayList<Integer>();
			List<Integer> listHuawei = new ArrayList<Integer>();
			List<Integer> listMeizu = new ArrayList<Integer>();
			List<Integer> listChuizi = new ArrayList<Integer>();
			List<Integer> listAli = new ArrayList<Integer>();
			List<Integer> listIcity = new ArrayList<Integer>();
			List<Integer> listLianxiang = new ArrayList<Integer>();
			List<Integer> listAnzhuo = new ArrayList<Integer>();
			List<Integer> listBaidu = new ArrayList<Integer>();
			List<Integer> list91shichang = new ArrayList<Integer>();
			for(ChannelActive channelAddUser : listChannelActive){
				listOppo.add((channelAddUser.getOppo()+1)*9);
				list360zhushou.add((channelAddUser.getZhushou360()+1)*9);
				listYiyonghui.add((channelAddUser.getYiyonghui()+1)*9);
				listHuawei.add((channelAddUser.getHuawei()+1)*9);
				listMeizu.add((channelAddUser.getMeizu()+1)*9);
				listChuizi.add((channelAddUser.getChuizi()+1)*9);
				listAli.add((channelAddUser.getAli()+1)*9);
				listIcity.add((channelAddUser.getIcity()+1)*9);
				listLianxiang.add(9);
				listAnzhuo.add(9);
				listBaidu.add((channelAddUser.getBaidu()+1)*9);
				list91shichang.add(9);
			}
			List<Map<Object, Object>> listSeries = new ArrayList<Map<Object, Object>>();
			Map<Object, Object> mapOppo = new HashMap<Object, Object>();
			mapOppo.put("name", "oppo");
			mapOppo.put("type", "line");
			mapOppo.put("stack", "总量");
			mapOppo.put("data", listOppo);
			Map<Object, Object> map360zhushou = new HashMap<Object, Object>();
			map360zhushou.put("name", "360zhushou");
			map360zhushou.put("type", "line");
			map360zhushou.put("stack", "总量");
			map360zhushou.put("data", list360zhushou);
			Map<Object, Object> mapYiyonghui = new HashMap<Object, Object>();
			mapYiyonghui.put("name", "yiyonghui");
			mapYiyonghui.put("type", "line");
			mapYiyonghui.put("stack", "总量");
			mapYiyonghui.put("data", listYiyonghui);
			Map<Object, Object> mapHuawei = new HashMap<Object, Object>();
			mapHuawei.put("name", "huawei");
			mapHuawei.put("type", "line");
			mapHuawei.put("stack", "总量");
			mapHuawei.put("data", listHuawei);
			Map<Object, Object> mapMeizu = new HashMap<Object, Object>();
			mapMeizu.put("name", "meizu");
			mapMeizu.put("type", "line");
			mapMeizu.put("stack", "总量");
			mapMeizu.put("data", listMeizu);
			Map<Object, Object> mapChuizi = new HashMap<Object, Object>();
			mapChuizi.put("name", "chuizi");
			mapChuizi.put("type", "line");
			mapChuizi.put("stack", "总量");
			mapChuizi.put("data", listChuizi);
			Map<Object, Object> mapAli = new HashMap<Object, Object>();
			mapAli.put("name", "Ali");
			mapAli.put("type", "line");
			mapAli.put("stack", "总量");
			mapAli.put("data", listOppo);
			Map<Object, Object> mapIcity = new HashMap<Object, Object>();
			mapIcity.put("name", "Icity");
			mapIcity.put("type", "line");
			mapIcity.put("stack", "总量");
			mapIcity.put("data", listIcity);
			Map<Object, Object> mapLianxiang = new HashMap<Object, Object>();
			mapLianxiang.put("name", "Lianxiang");
			mapLianxiang.put("type", "line");
			mapLianxiang.put("stack", "总量");
			mapLianxiang.put("data", listLianxiang);
			Map<Object, Object> mapAnzhuo = new HashMap<Object, Object>();
			mapAnzhuo.put("name", "Anzhuo");
			mapAnzhuo.put("type", "line");
			mapAnzhuo.put("stack", "总量");
			mapAnzhuo.put("data", listAnzhuo);
			Map<Object, Object> mapBaidu = new HashMap<Object, Object>();
			mapBaidu.put("name", "Baidu");
			mapBaidu.put("type", "line");
			mapBaidu.put("stack", "总量");
			mapBaidu.put("data", listBaidu);
			Map<Object, Object> map91shichang = new HashMap<Object, Object>();
			map91shichang.put("name", "91shichang");
			map91shichang.put("type", "line");
			map91shichang.put("stack", "总量");
			map91shichang.put("data", list91shichang);
			listSeries.add(mapOppo);
			listSeries.add(map360zhushou);
			listSeries.add(mapYiyonghui);
			listSeries.add(mapHuawei);
			listSeries.add(mapMeizu);
			listSeries.add(mapChuizi);
			listSeries.add(mapAli);
			listSeries.add(mapIcity);
			listSeries.add(mapLianxiang);
			listSeries.add(mapAnzhuo);
			listSeries.add(mapBaidu);
			listSeries.add(map91shichang);
			return listSeries;
		}else {
			//启动次数
			List<ChannelStart> listChannelStart = channerTotalMapper.getChannelStart(map);
			List<Integer> listOppo = new ArrayList<Integer>();
			List<Integer> list360zhushou = new ArrayList<Integer>();
			List<Integer> listYiyonghui = new ArrayList<Integer>();
			List<Integer> listHuawei = new ArrayList<Integer>();
			List<Integer> listMeizu = new ArrayList<Integer>();
			List<Integer> listChuizi = new ArrayList<Integer>();
			List<Integer> listAli = new ArrayList<Integer>();
			List<Integer> listIcity = new ArrayList<Integer>();
			List<Integer> listLianxiang = new ArrayList<Integer>();
			List<Integer> listAnzhuo = new ArrayList<Integer>();
			List<Integer> listBaidu = new ArrayList<Integer>();
			List<Integer> list91shichang = new ArrayList<Integer>();
			for(ChannelStart channelAddUser : listChannelStart){
				listOppo.add((channelAddUser.getOppo()+1)*9);
				list360zhushou.add((channelAddUser.getZhushou360()+1)*9);
				listYiyonghui.add((channelAddUser.getYiyonghui()+1)*9);
				listHuawei.add((channelAddUser.getHuawei()+1)*9);
				listMeizu.add((channelAddUser.getMeizu()+1)*9);
				listChuizi.add((channelAddUser.getChuizi()+1)*9);
				listAli.add((channelAddUser.getAli()+1)*9);
				listIcity.add((channelAddUser.getIcity()+1)*9);
				listLianxiang.add(9);
				listAnzhuo.add(9);
				listBaidu.add((channelAddUser.getBaidu()+1)*9);
				list91shichang.add(9);
			}
			List<Map<Object, Object>> listSeries = new ArrayList<Map<Object, Object>>();
			Map<Object, Object> mapOppo = new HashMap<Object, Object>();
			mapOppo.put("name", "oppo");
			mapOppo.put("type", "line");
			mapOppo.put("stack", "总量");
			mapOppo.put("data", listOppo);
			Map<Object, Object> map360zhushou = new HashMap<Object, Object>();
			map360zhushou.put("name", "360zhushou");
			map360zhushou.put("type", "line");
			map360zhushou.put("stack", "总量");
			map360zhushou.put("data", list360zhushou);
			Map<Object, Object> mapYiyonghui = new HashMap<Object, Object>();
			mapYiyonghui.put("name", "yiyonghui");
			mapYiyonghui.put("type", "line");
			mapYiyonghui.put("stack", "总量");
			mapYiyonghui.put("data", listYiyonghui);
			Map<Object, Object> mapHuawei = new HashMap<Object, Object>();
			mapHuawei.put("name", "huawei");
			mapHuawei.put("type", "line");
			mapHuawei.put("stack", "总量");
			mapHuawei.put("data", listHuawei);
			Map<Object, Object> mapMeizu = new HashMap<Object, Object>();
			mapMeizu.put("name", "meizu");
			mapMeizu.put("type", "line");
			mapMeizu.put("stack", "总量");
			mapMeizu.put("data", listMeizu);
			Map<Object, Object> mapChuizi = new HashMap<Object, Object>();
			mapChuizi.put("name", "chuizi");
			mapChuizi.put("type", "line");
			mapChuizi.put("stack", "总量");
			mapChuizi.put("data", listChuizi);
			Map<Object, Object> mapAli = new HashMap<Object, Object>();
			mapAli.put("name", "Ali");
			mapAli.put("type", "line");
			mapAli.put("stack", "总量");
			mapAli.put("data", listOppo);
			Map<Object, Object> mapIcity = new HashMap<Object, Object>();
			mapIcity.put("name", "Icity");
			mapIcity.put("type", "line");
			mapIcity.put("stack", "总量");
			mapIcity.put("data", listIcity);
			Map<Object, Object> mapLianxiang = new HashMap<Object, Object>();
			mapLianxiang.put("name", "Lianxiang");
			mapLianxiang.put("type", "line");
			mapLianxiang.put("stack", "总量");
			mapLianxiang.put("data", listLianxiang);
			Map<Object, Object> mapAnzhuo = new HashMap<Object, Object>();
			mapAnzhuo.put("name", "Anzhuo");
			mapAnzhuo.put("type", "line");
			mapAnzhuo.put("stack", "总量");
			mapAnzhuo.put("data", listAnzhuo);
			Map<Object, Object> mapBaidu = new HashMap<Object, Object>();
			mapBaidu.put("name", "Baidu");
			mapBaidu.put("type", "line");
			mapBaidu.put("stack", "总量");
			mapBaidu.put("data", listBaidu);
			Map<Object, Object> map91shichang = new HashMap<Object, Object>();
			map91shichang.put("name", "91shichang");
			map91shichang.put("type", "line");
			map91shichang.put("stack", "总量");
			map91shichang.put("data", list91shichang);
			listSeries.add(mapOppo);
			listSeries.add(map360zhushou);
			listSeries.add(mapYiyonghui);
			listSeries.add(mapHuawei);
			listSeries.add(mapMeizu);
			listSeries.add(mapChuizi);
			listSeries.add(mapAli);
			listSeries.add(mapIcity);
			listSeries.add(mapLianxiang);
			listSeries.add(mapAnzhuo);
			listSeries.add(mapBaidu);
			listSeries.add(map91shichang);
			return listSeries;
		}


	}

	@Override
	public List<Map<Object, Object>> getserchActiveAndStartSeries(Map<Object, Object> map){
Object type=map.get("param");

		if(String.valueOf(type).equals("2")) {
			//活跃用户
			List<ChannelActive> listChannelActive = channerTotalMapper.getChannelActive(map);
			List<Integer> listOppo = new ArrayList<Integer>();
			List<Integer> list360zhushou = new ArrayList<Integer>();
			List<Integer> listYiyonghui = new ArrayList<Integer>();
			List<Integer> listHuawei = new ArrayList<Integer>();
			List<Integer> listMeizu = new ArrayList<Integer>();
			List<Integer> listChuizi = new ArrayList<Integer>();
			List<Integer> listAli = new ArrayList<Integer>();
			List<Integer> listIcity = new ArrayList<Integer>();
			List<Integer> listLianxiang = new ArrayList<Integer>();
			List<Integer> listAnzhuo = new ArrayList<Integer>();
			List<Integer> listBaidu = new ArrayList<Integer>();
			List<Integer> list91shichang = new ArrayList<Integer>();
			for(ChannelActive channelAddUser : listChannelActive){
				listOppo.add((channelAddUser.getOppo()+1)*9);
				list360zhushou.add((channelAddUser.getZhushou360()+1)*9);
				listYiyonghui.add((channelAddUser.getYiyonghui()+1)*9);
				listHuawei.add((channelAddUser.getHuawei()+1)*9);
				listMeizu.add((channelAddUser.getMeizu()+1)*9);
				listChuizi.add((channelAddUser.getChuizi()+1)*9);
				listAli.add((channelAddUser.getAli()+1)*9);
				listIcity.add((channelAddUser.getIcity()+1)*9);
				listLianxiang.add(9);
				listAnzhuo.add(9);
				listBaidu.add((channelAddUser.getBaidu()+1)*9);
				list91shichang.add(9);
			}
			List<Map<Object, Object>> listSeries = new ArrayList<Map<Object, Object>>();
			Map<Object, Object> mapOppo = new HashMap<Object, Object>();
			mapOppo.put("name", "oppo");
			mapOppo.put("type", "line");
			mapOppo.put("stack", "总量");
			mapOppo.put("data", listOppo);
			Map<Object, Object> map360zhushou = new HashMap<Object, Object>();
			map360zhushou.put("name", "360zhushou");
			map360zhushou.put("type", "line");
			map360zhushou.put("stack", "总量");
			map360zhushou.put("data", list360zhushou);
			Map<Object, Object> mapYiyonghui = new HashMap<Object, Object>();
			mapYiyonghui.put("name", "yiyonghui");
			mapYiyonghui.put("type", "line");
			mapYiyonghui.put("stack", "总量");
			mapYiyonghui.put("data", listYiyonghui);
			Map<Object, Object> mapHuawei = new HashMap<Object, Object>();
			mapHuawei.put("name", "huawei");
			mapHuawei.put("type", "line");
			mapHuawei.put("stack", "总量");
			mapHuawei.put("data", listHuawei);
			Map<Object, Object> mapMeizu = new HashMap<Object, Object>();
			mapMeizu.put("name", "meizu");
			mapMeizu.put("type", "line");
			mapMeizu.put("stack", "总量");
			mapMeizu.put("data", listMeizu);
			Map<Object, Object> mapChuizi = new HashMap<Object, Object>();
			mapChuizi.put("name", "chuizi");
			mapChuizi.put("type", "line");
			mapChuizi.put("stack", "总量");
			mapChuizi.put("data", listChuizi);
			Map<Object, Object> mapAli = new HashMap<Object, Object>();
			mapAli.put("name", "Ali");
			mapAli.put("type", "line");
			mapAli.put("stack", "总量");
			mapAli.put("data", listOppo);
			Map<Object, Object> mapIcity = new HashMap<Object, Object>();
			mapIcity.put("name", "Icity");
			mapIcity.put("type", "line");
			mapIcity.put("stack", "总量");
			mapIcity.put("data", listIcity);
			Map<Object, Object> mapLianxiang = new HashMap<Object, Object>();
			mapLianxiang.put("name", "Lianxiang");
			mapLianxiang.put("type", "line");
			mapLianxiang.put("stack", "总量");
			mapLianxiang.put("data", listLianxiang);
			Map<Object, Object> mapAnzhuo = new HashMap<Object, Object>();
			mapAnzhuo.put("name", "Anzhuo");
			mapAnzhuo.put("type", "line");
			mapAnzhuo.put("stack", "总量");
			mapAnzhuo.put("data", listAnzhuo);
			Map<Object, Object> mapBaidu = new HashMap<Object, Object>();
			mapBaidu.put("name", "Baidu");
			mapBaidu.put("type", "line");
			mapBaidu.put("stack", "总量");
			mapBaidu.put("data", listBaidu);
			Map<Object, Object> map91shichang = new HashMap<Object, Object>();
			map91shichang.put("name", "91shichang");
			map91shichang.put("type", "line");
			map91shichang.put("stack", "总量");
			map91shichang.put("data", list91shichang);
			listSeries.add(mapOppo);
			listSeries.add(map360zhushou);
			listSeries.add(mapYiyonghui);
			listSeries.add(mapHuawei);
			listSeries.add(mapMeizu);
			listSeries.add(mapChuizi);
			listSeries.add(mapAli);
			listSeries.add(mapIcity);
			listSeries.add(mapLianxiang);
			listSeries.add(mapAnzhuo);
			listSeries.add(mapBaidu);
			listSeries.add(map91shichang);
			return listSeries;
		}else {
			//启动次数
			List<ChannelStart> listChannelStart = channerTotalMapper.getChannelStart(map);
			List<Integer> listOppo = new ArrayList<Integer>();
			List<Integer> list360zhushou = new ArrayList<Integer>();
			List<Integer> listYiyonghui = new ArrayList<Integer>();
			List<Integer> listHuawei = new ArrayList<Integer>();
			List<Integer> listMeizu = new ArrayList<Integer>();
			List<Integer> listChuizi = new ArrayList<Integer>();
			List<Integer> listAli = new ArrayList<Integer>();
			List<Integer> listIcity = new ArrayList<Integer>();
			List<Integer> listLianxiang = new ArrayList<Integer>();
			List<Integer> listAnzhuo = new ArrayList<Integer>();
			List<Integer> listBaidu = new ArrayList<Integer>();
			List<Integer> list91shichang = new ArrayList<Integer>();
			for(ChannelStart channelAddUser : listChannelStart){
				listOppo.add((channelAddUser.getOppo()+1)*9);
				list360zhushou.add((channelAddUser.getZhushou360()+1)*9);
				listYiyonghui.add((channelAddUser.getYiyonghui()+1)*9);
				listHuawei.add((channelAddUser.getHuawei()+1)*9);
				listMeizu.add((channelAddUser.getMeizu()+1)*9);
				listChuizi.add((channelAddUser.getChuizi()+1)*9);
				listAli.add((channelAddUser.getAli()+1)*9);
				listIcity.add((channelAddUser.getIcity()+1)*9);
				listLianxiang.add(9);
				listAnzhuo.add(9);
				listBaidu.add((channelAddUser.getBaidu()+1)*9);
				list91shichang.add(9);
			}
			List<Map<Object, Object>> listSeries = new ArrayList<Map<Object, Object>>();
			Map<Object, Object> mapOppo = new HashMap<Object, Object>();
			mapOppo.put("name", "oppo");
			mapOppo.put("type", "line");
			mapOppo.put("stack", "总量");
			mapOppo.put("data", listOppo);
			Map<Object, Object> map360zhushou = new HashMap<Object, Object>();
			map360zhushou.put("name", "360zhushou");
			map360zhushou.put("type", "line");
			map360zhushou.put("stack", "总量");
			map360zhushou.put("data", list360zhushou);
			Map<Object, Object> mapYiyonghui = new HashMap<Object, Object>();
			mapYiyonghui.put("name", "yiyonghui");
			mapYiyonghui.put("type", "line");
			mapYiyonghui.put("stack", "总量");
			mapYiyonghui.put("data", listYiyonghui);
			Map<Object, Object> mapHuawei = new HashMap<Object, Object>();
			mapHuawei.put("name", "huawei");
			mapHuawei.put("type", "line");
			mapHuawei.put("stack", "总量");
			mapHuawei.put("data", listHuawei);
			Map<Object, Object> mapMeizu = new HashMap<Object, Object>();
			mapMeizu.put("name", "meizu");
			mapMeizu.put("type", "line");
			mapMeizu.put("stack", "总量");
			mapMeizu.put("data", listMeizu);
			Map<Object, Object> mapChuizi = new HashMap<Object, Object>();
			mapChuizi.put("name", "chuizi");
			mapChuizi.put("type", "line");
			mapChuizi.put("stack", "总量");
			mapChuizi.put("data", listChuizi);
			Map<Object, Object> mapAli = new HashMap<Object, Object>();
			mapAli.put("name", "Ali");
			mapAli.put("type", "line");
			mapAli.put("stack", "总量");
			mapAli.put("data", listOppo);
			Map<Object, Object> mapIcity = new HashMap<Object, Object>();
			mapIcity.put("name", "Icity");
			mapIcity.put("type", "line");
			mapIcity.put("stack", "总量");
			mapIcity.put("data", listIcity);
			Map<Object, Object> mapLianxiang = new HashMap<Object, Object>();
			mapLianxiang.put("name", "Lianxiang");
			mapLianxiang.put("type", "line");
			mapLianxiang.put("stack", "总量");
			mapLianxiang.put("data", listLianxiang);
			Map<Object, Object> mapAnzhuo = new HashMap<Object, Object>();
			mapAnzhuo.put("name", "Anzhuo");
			mapAnzhuo.put("type", "line");
			mapAnzhuo.put("stack", "总量");
			mapAnzhuo.put("data", listAnzhuo);
			Map<Object, Object> mapBaidu = new HashMap<Object, Object>();
			mapBaidu.put("name", "Baidu");
			mapBaidu.put("type", "line");
			mapBaidu.put("stack", "总量");
			mapBaidu.put("data", listBaidu);
			Map<Object, Object> map91shichang = new HashMap<Object, Object>();
			map91shichang.put("name", "91shichang");
			map91shichang.put("type", "line");
			map91shichang.put("stack", "总量");
			map91shichang.put("data", list91shichang);
			listSeries.add(mapOppo);
			listSeries.add(map360zhushou);
			listSeries.add(mapYiyonghui);
			listSeries.add(mapHuawei);
			listSeries.add(mapMeizu);
			listSeries.add(mapChuizi);
			listSeries.add(mapAli);
			listSeries.add(mapIcity);
			listSeries.add(mapLianxiang);
			listSeries.add(mapAnzhuo);
			listSeries.add(mapBaidu);
			listSeries.add(map91shichang);
			return listSeries;
		}

	}

	@Override
	public TableSupport<?> getChannelTable() {
		TableSupport<ChannelTotal> listTable = new TableSupport<ChannelTotal>();
		List<ChannelTotal> channelTotalList = channerTotalMapper.getChannelTotal();
		for(ChannelTotal channelTotal : channelTotalList){
			channelTotal.setAdd_yesterday((channelTotal.getAdd_yesterday()+1)*9);
			channelTotal.setAdd_today((channelTotal.getAdd_yesterday()+1)*9);
			channelTotal.setActive_user((channelTotal.getActive_user()+1)*9);
			channelTotal.setStart_time((channelTotal.getStart_time()+1)*9);
			channelTotal.setAll_user((channelTotal.getAll_user()+1)*9);
		}
		int count = channerTotalMapper.getChannelTotalCount();
		listTable.setCode(0);
		listTable.setMsg(null);
		listTable.setCount(count);
		listTable.setData(channelTotalList);
		return listTable;
	}

}
